<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String basepath = request.getContextPath(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="<%=basepath%>/resources/js/plugins/TreeTable/css/jquery.treeTable.css" rel="stylesheet"
          type="text/css"/>
    <link href="<%=basepath%>/resources/css/index.css" rel="stylesheet" type="text/css"/>
    <script src="<%=basepath%>/resources/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <style>
        .treeTable {
            border: solid 1px #000;
            border-top: none;
        }

        .treeTable tbody tr td {
            border: 1px solid #000 !important;
            padding: 8px 0px 8px 5px !important;
            color: #000 !important;
            background: #FFF !important;
        }

        .printmenu {
            text-align: right;
        }

        .printmenu button {
            border: none;
            background: orange;
            padding: 5px;
            color: #FFF;
        }

        .printmenu button:hover {
            background: #FF8000;
        }

        body {
            background: none !important;
            font-family: "宋体" !important;
            font-size: 18px;
        }

        #allpage {
            background: none !important;
        }

        .resumetitle {
            padding: 10px !important;
            height: auto !important;
            background: #DDD !important;
            color: #000 !important;
            font-weight: bold;
            letter-spacing: 2px;
            border: 1px solid #000;
            border-bottom: none;
            border-top: none;
        }

        .inputform tbody tr td {
            letter-spacing: 0px !important;
        }
    </style>
</head>
<body onload="initView()">
<div id="loader"><img alt="" src="<%=basepath%>/resources/image/1d_2.gif"/></div>

<div id="Content" style="width:980px; height:auto; margin:0 auto;">
    <div class="printmenu">
        <div style="color:red;float:left;">${tips}</div>
        <button type="button" onclick="PrintFunc()">打印简历</button>
        <button type="button" onclick="EditFunc()">修改简历</button>
    </div>
    <div class="pagecont" style="width:980px; padding-left:0;padding-bottom:20px;">
        <div style="font-size:30px;font-family:'黑体';font-weight:bold;padding:20px;text-align:center;letter-spacing:2px;">
            个人简历
        </div>
        <div style="font-weight:bold;padding:10px 0;">简历编号：${userresume.code}</div>
        <div class="resumetitle" style="text-align:center;border-top:1px solid #000;">个人信息</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="120">姓名：</td>
                <td width="280">${userresume.name}</td>
                <td width="120">性别：</td>
                <td>${userresume.sexname}</td>
                <td rowspan="6" width="167">
                    <c:choose>
                        <c:when test="${empty userresume.head}">
                            <img name="head" width="160" height="224"
                                 src="${fpath}/resources/UserHead/default-photo.png"/>
                        </c:when>
                        <c:otherwise>
                            <img name="head" width="160" height="224"
                                 src="${fpath}/resources/UserHead/${userresume.head}"/>
                        </c:otherwise>
                    </c:choose>
                </td>
            </tr>
            <tr>
                <td>出生日期：</td>
                <td><fmt:formatDate value="${userresume.birthday}" pattern="yyyy-MM-dd"/></td>
                <td>电子邮箱：</td>
                <td>${userresume.email}</td>
            </tr>
            <tr>
                <td>手机号码：</td>
                <td>${userresume.tel}</td>
                <td>家庭电话：</td>
                <td>${userresume.hometel}</td>
            </tr>
            <tr>
                <td>民族：</td>
                <td>${userresume.mzname}</td>
                <td>籍贯：</td>
                <td>${userresume.jg}</td>
            </tr>
            <tr>
                <td>政治面貌：</td>
                <td>${userresume.zzmmname}</td>
                <td>身高(CM)：</td>
                <td>${userresume.height}</td>
            </tr>
            <tr>
                <td>婚姻状况：</td>
                <td>${userresume.mname}</td>
                <td>服从调配：</td>
                <td>
                    <select name="userresume.distribution" datatype="*" nullmsg="请选择是否服从调配！">
                        <option value="">请选择</option>
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                    <input type="hidden" value="${userresume.distribution}"/>
                </td>
            </tr>
            <tr>
                <td>身份证号：</td>
                <td >${userresume.cardno}</td>
                <td>应聘岗位：</td>
                <td colspan="2">${userresume.jname}</td>
            </tr>
            <tr>
                <td>户口性质：</td>
                <td>${userresume.hkname}</td>
                <td>户口所在地：</td>
                <td colspan="2">${userresume.hukouaddress}</td>
            </tr>
            <tr>
                <td>现居住地：</td>
                <td colspan="4">${userresume.nowaddress}</td>
            </tr>
            </tbody>
        </table>
        <div class="resumetitle">职业概况/求职意向</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="120">工作经验(年)：</td>
                <td width="280">${userresume.workexperience}</td>
                <td width="120">到岗时间：</td>
                <td>${userresume.attendancetime}</td>
            </tr>
            <tr>
                <td>意向工作地区:</td>
                <td>${userresume.presentsalaryamount}</td>
                <td>期望月薪(RMB):</td>
                <td>${userresume.expectedsalaryamount}</td>
            </tr>
            </tbody>
        </table>
        <div class="resumetitle">教育背景</div>
        <div>
            <table class="treeTable inputform">
                <tbody>
                <tr>
                    <td width="120">入学时间</td>
                    <td width="100">毕业时间</td>
                    <td>学校名称</td>
                    <td>专业名称</td>
                    <td width="80">学历</td>
                    <td width="80">学位</td>
                    <td width="110">学习形式</td>
                    <td width="75">毕业情况</td>
                   <%-- <td width="75">成绩平均分</td>
                    <td width="75">平均学分绩点</td>--%>
                </tr>
                <c:forEach var="education" items="${educations}">
                    <tr>
                        <td><fmt:formatDate value="${education.starttime}" pattern="yyyy-MM-dd"/></td>
                        <td><fmt:formatDate value="${education.endtime}" pattern="yyyy-MM-dd"/></td>
                        <td>${education.schoolname}</td>
                        <td>${education.majorname}</td>
                        <td>${education.educationname}</td>
                        <td>${education.degreename}</td>
                        <td>${education.fulltime}</td>
                        <td>${education.tname}</td>
                       <%-- <td>${education.tname}</td>
                        <td>${education.tname}</td>--%>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
        <c:if test="${not empty workexperiences}">
            <div class="resumetitle">大学期间社会实践经历</div>
        </c:if>
        <div>
            <c:forEach var="workexperience" items="${workexperiences}">
                <table class="treeTable inputform">
                    <tbody>
                    <tr>
                        <td>公司名称：</td>
                        <td>${workexperience.companyname}</td>
                        <td>薪资待遇：</td>
                        <td>${workexperience.salary}</td>
                    </tr>
                    <tr>
                        <td width="120">开始时间：</td>
                        <td width="280"><fmt:formatDate value="${workexperience.starttime}" pattern="yyyy-MM-dd"/></td>
                        <td width="120">结束时间：</td>
                        <td><fmt:formatDate value="${workexperience.endtime}" pattern="yyyy-MM-dd"/></td>
                    </tr>
                    <tr>
                        <td>工作部门：</td>
                        <td>${workexperience.department}</td>
                        <td>工作岗位：</td>
                        <td>${workexperience.position}</td>
                    </tr>
                    <tr>
                        <td>工作内容：</td>
                        <td colspan="3">${workexperience.jobduties}</td>
                    </tr>
                    <tr>
                        <td>离职原因：</td>
                        <td colspan="3">${workexperience.reason}</td>
                    </tr>
                    </tbody>
                </table>

            </c:forEach>
        </div>
        <c:if test="${not empty userresume.postspecialty}">
            <div class="resumetitle">大学期间所获奖项</div>
            <table class="treeTable inputform">
                <tbody>
                <tr>
                    <td width="120">类别</td>
                    <td width="140">所属专业</td>
                    <td width="135">级别</td>
                    <td width="120">取得时间</td>
                    <td>发证机构</td>
                </tr>
                <tr>
                    <td>${userresume.posttypename}</td>
                    <td>${userresume.postspecialty}</td>
                    <td>${userresume.postlevelname}</td>
                    <td><fmt:formatDate value="${userresume.postgettime}" pattern="yyyy-MM-dd"/></td>
                    <td>${userresume.postcompany}</td>
                </tr>
                </tbody>
            </table>
        </c:if>
        <c:if test="${not empty userresume.qltype}">
            <div class="resumetitle">职业资格证</div>
            <table class="treeTable inputform">
                <tbody>
                <tr>
                    <td width="120">技能等级</td>
                    <td width="140">工种</td>
                    <td width="135">取得时间</td>
                    <td>发证机构</td>
                </tr>
                <tr>
                    <td>${userresume.qllevelpname} ${userresume.qllevelname} ${userresume.qllevelsname}</td>
                    <td>${userresume.qltype}</td>
                    <td><fmt:formatDate value="${userresume.qlgettime}" pattern="yyyy-MM-dd"/></td>
                    <td>${userresume.qlorg}</td>
                </tr>
                </tbody>
            </table>
        </c:if>
        <c:if test="${not empty userresume.othname}">
            <div class="resumetitle">其他资格证（如：驾驶证等）</div>
            <table class="treeTable inputform">
                <tbody>
                <tr>
                    <td width="120">名称</td>
                    <td width="140">证书编号</td>
                    <td width="135">类型</td>
                    <td width="120">专业</td>
                    <td width="100">取得时间</td>
                    <td>发证机构</td>
                </tr>
                <tr>
                    <td>${userresume.othname}</td>
                    <td>${userresume.othcode}</td>
                    <td>${userresume.othtypename}</td>
                    <td>${userresume.othzy}</td>
                    <td><fmt:formatDate value="${userresume.othdate}" pattern="yyyy-MM-dd"/></td>
                    <td>${userresume.othorg}</td>
                </tr>
                </tbody>
            </table>
        </c:if>
        <c:if test="${not empty trainings}">
            <div class="resumetitle">培训经历</div>
        </c:if>
        <div>
            <c:forEach var="training" items="${trainings}">
                <table class="treeTable inputform">
                    <tbody>
                    <tr>
                        <td width="120">开始时间：</td>
                        <td width="280"><fmt:formatDate value="${training.starttime}" pattern="yyyy-MM-dd"/></td>
                        <td width="120">结束时间：</td>
                        <td><fmt:formatDate value="${training.endtime}" pattern="yyyy-MM-dd"/></td>
                    </tr>
                    <tr>
                        <td>培训课程：</td>
                        <td>${training.course}</td>
                        <td>培训机构：</td>
                        <td>${training.organization}</td>
                    </tr>
                    <tr>
                        <td>获得证书：</td>
                        <td colspan="3">${training.certificate}</td>
                    </tr>
                    <tr>
                        <td>培训内容：</td>
                        <td colspan="3">${training.description}</td>
                    </tr>
                    </tbody>
                </table>

            </c:forEach>
        </div>

        <c:if test="${not empty rewardpunishments}">
            <div class="resumetitle">获奖情况</div>
        </c:if>
        <div>
            <c:forEach var="rewardpunishment" items="${rewardpunishments}">
                <table class="treeTable inputform">
                    <tbody>
                    <tr>
                        <td width="120">奖励单位：</td>
                        <td width="280">${rewardpunishment.enterprise}</td>
                        <td width="120">奖励名称：</td>
                        <td>${rewardpunishment.name}</td>
                        <td width="90">获得时间：</td>
                        <td width="100"><fmt:formatDate value="${rewardpunishment.gettime}" pattern="yyyy-MM-dd"/></td>
                    </tr>
                    <tr>
                        <td>奖励原因：</td>
                        <td colspan="5">${rewardpunishment.reason}</td>
                    </tr>
                    </tbody>
                </table>

            </c:forEach>
        </div>

        <c:if test="${not empty families}">
            <div class="resumetitle">家庭成员</div>
            <div>
                <table class="treeTable inputform">
                    <tbody>
                    <tr>
                        <td width="120">关系</td>
                        <td width="90">姓名</td>
                        <td width="95">出生日期</td>
                        <td>单位</td>
                        <td>职务</td>
                        <td width="110">联系方式</td>
                    </tr>
                    <c:forEach var="familie" items="${families}">
                        <tr>
                            <td>${familie.relationship}</td>
                            <td>${familie.name}</td>
                            <td><fmt:formatDate value="${familie.birthday}" pattern="yyyy-MM-dd"/></td>
                            <td>${familie.workunit}</td>
                            <td>${familie.profession}</td>
                            <td>${familie.contactway}</td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </c:if>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        if ('${valid}' == 'no') {
            $('#Content').html('<div style="padding:100px 0; text-align:center; font-size:16px;">应聘者未投简历</div>');
        }

        $('select').each(function () {
            $(this).val($(this).next().val());
            $(this).parent().html($(this).find("option:selected").text());
        });

    });

    function initView() {
        setTimeout(function () {
            $('#loader').hide();
        }, 200);
    }

    function PrintFunc() {
        $('.printmenu').hide();
        $('.resumetitle').css("background-color", "#ddd");
        $('.resumetitle').css("color", "#000");
        window.print();
        $('.printmenu').show();
        $('.resumetitle').css("background-color", "#017C83");
        $('.resumetitle').css("color", "#fff");
    }

    function EditFunc() {
        window.open('<%=basepath%>/Do/SZResume/Edit?id=${userresume.id}');
    }
</script>
</body>
</html>